<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>问题详情</title>
    <link rel="stylesheet" href="../css/index.css" />
    <link rel="stylesheet" href="../css/font-icons.css" />
    <script src="../js/jquery-1.7.2.min.js"></script>
</head>
<body>
<div id="header">
    <span class="ti-user">用户：</span>
    <span class="userName"></span>
    <span class="enter">退出登录</span>
    <a href="html/modifyPassword.html"><span  class="amend"> 修改密码</span></a>
</div>
<div id="detail">
</div>
<div class="bigImg"></div>
<div id="footer">
    <ul>
        <li>
            <a href="../index.html">
               <div>首页</div>
            </a>
        </li>
        <li>
            <a href="add.html">
                <div>添加</div>
            </a>
        </li>
        <li>
            <a href="caculate.html">
               <div>统计</div>
            </a>
        </li>
        <li>
            <a href="mine.html">
                <div>我的</div>
            </a>
        </li>
    </ul>
</div>

<script>
    if(localStorage.token =="undefined"){
        alert('请先登录')
        window.location.href = 'login.html'
    }
    $('.userName').html(localStorage.userName);
    $('.enter').click(function(){
        localStorage.token = '';
        localStorage.userid = '';
        window.location.href = 'login.html'
    })

    //获取问题id
    var pk_support=window.location.search.split("pk_support=")[1];

    var params={
        beginindex:1,
        endindex:1,
        param:JSON.stringify({pk_support:pk_support})
    };
    $.post(localStorage.location+"alldhsupports",params,function(data){
        var data=data.data[0];

        switch(data.supporttype){
            case "bug":
                var name="BUG";
                break;
            case "demand":
                var name="需求";
                break;
        }
        var appendStr=
            '<ul>'+
                '<li>'+
                    '<span class="title_F">录单时间:</span>'+
                    '<span class="text">'+(data.creationtime?data.creationtime:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">状态:</span>'+
                    (data.supportstatus=="已解决"?'<span class="state_A">'+data.supportstatus+'</span>':"")+
                    (data.supportstatus=="进行中"?'<span class="doing_A">'+data.supportstatus+'</span>':"")+
                    (data.supportstatus=="未开始"?'<span class="notstart_A">'+data.supportstatus +'</span>' : "") +
                '</li>'+
                '<li>'+
                    '<span class="title_F">大区:</span>'+
                    '<span class="text">'+(data.areaname?data.areaname:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">项目名称:</span>'+
                    '<span class="text">'+(data.projectname?data.projectname:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">领域:</span>'+
                    '<span class="text">'+(data.field?data.field:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">录单人:</span>'+
                    '<span class="text">'+(data.creatorname?data.creatorname:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">解决人:</span>'+
                    '<span class="text">'+(data.namemobile?data.namemobile:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">修改人:</span>'+
                    '<span class="text">'+(data.modifiername?data.modifiername:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F name">'+name+'名称:</span>'+
                    '<span class="text">'+(data.supportname?data.supportname:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F ">'+name+'描述:</span>'+
                    '<span class="text">'+(data.description?data.description.replace(/~@~@~/g,"<br/>"):"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">计划用时:</span>'+
                    '<span class="text">'+(data.plantime?data.plantime+data.timeunits:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">计划完成时间:</span>'+
                    '<span class="text">'+(data.finishtime?data.finishtime:"")+'</span>'+
                '</li>'+
                '<li>'+
                    '<span class="title_F">实际用时:</span>'+
                    '<span class="text">'+(data.actualtime?data.actualtime+data.timeunits:"")+'</span>'+
                '</li>'+
              '<li>'+
                     '<span class="title_F">加班用时:</span>'+
                     '<span class="text">'+(data.overtime?data.overtime+data.timeunits:"")+'</span>'+
              '</li>'+
                '<li>'+
                    '<span class="title_F">图片:</span>'+
                    '<div class="text">'+
                        (data.image1?'<img id="image1" src="'+data.image1+".square.thumb.jpg"+'" alt="">':"")+
                        (data.image2?'<img id="image2" src="'+data.image2+".square.thumb.jpg"+'" alt="">':"")+
                        (data.image3?'<img id="image3" src="'+data.image3+".square.thumb.jpg"+'" alt="">':"")+
                        ((!data.image1)&&(!data.image2)&&(!data.image3)?'暂无图片':"")+
                    '</div>'+
                '</li>'+
            '</ul>';
        $("#detail").append(appendStr);
        $("img").on("click",function(){
            var srcBig=$(this).attr("src").split(".square")[0];
            var img = '<img class="img" src="'+srcBig+'">';
            $(".bigImg").html('').show().append(img) ;
//            $(".bigImg").css("backgroundImage","url("+srcBig+")");

        });

    });
    $(".bigImg").on("click",function(){
        $(this).hide();
    });



</script>
</body>
</html>